package com.tsc.stock.controller;

import com.tsc.common.response.ApiResponse;
import com.tsc.stock.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: chentl
 * @Date: 2025/08/28/09:45
 * @Description:
 */
@RestController
@RequestMapping("/stock")
public class StockController {

    @Autowired
    private StockService stockService;

    @GetMapping("/reduct")
    public ApiResponse reduct(@RequestParam(value="productId") Integer productId ){
        return ApiResponse.success(stockService.reduct(productId));
    }
}
